<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkIt(){
			if(document.replyTable.bqr_content.value==""){
				alert("내용을 입력하세요!");
				document.replyTable.bqr_content.focus();
				return false;
		}
	}
</script>
</head>
<body>
	<table border="1" rules="none" width="500">
		<tr>
			<td bgcolor="#FAFAD2">문의분류 : ${qboarddetail.bq_category}</td>
		</tr>
		<tr>
			<td>제목 : ${qboarddetail.bq_title}</td>
		</tr>
		<tr>
			<td bgcolor="#FAFAD2"> 	작성자 : ${qboarddetail.userid}</td>
		</tr>
		<tr>
			<td>답변여부 : ${qboarddetail.bq_status}	</td>
		</tr>
		<tr><td bgcolor="#FAFAD2">조회수 : ${qboarddetail.bq_readcnt}</td>
		</tr> 
		<tr>
			<td>내용 : ${qboarddetail.bq_content}</td>
		</tr>
		<tr>
			<td>
				<input type="button" value="삭제" onclick="location.href='qboarddelete.do?bq_num=${qboarddetail.bq_num}'">
				<input type="button" value="취소" onclick="location.href='qnalist.do'">
			</td>
		</tr>
	</table>
	<form action="qnadetailreply.do" name="replyTable" method="post" onSubmit="return checkIt()">
		<input type="hidden" name="bq_num" value="${qboarddetail.bq_num}">
		
		<table>
			<tr>
			<td> <textarea cols="40" rows="10" name="bqr_content"></textarea></td>
				 <td><input type="submit" value="답변 달기"></td>
			</tr>
				<c:forEach items="${list}" var="rep">
				<tr>
					<td>${rep.bqr_content}</td>
					<td>${rep.bqr_date} 
					<input type="button" value="삭제 " onclick="location.href='qnareplydel.do?bqr_num=${rep.bqr_num}&bq_num=${qboarddetail.bq_num}'"></td>
				</tr>		
				</c:forEach>	
		</table>
		</form>		
</body>
</html>